To be especially good or outstanding.
Once the party was over, everyone agreed that Elizabeth and her Harriet Tubman getup had taken the cake.
To be particularly bad, objectionable, or egregious.
I've seen bad grammar, but this takes the cake.